<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['环卫管理','车载屏幕','设置个人信息']" icon="fa fa-cube" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>设置个人信息</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"  [specifyTime]='initDateRange'></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="showAddUserModal(addUserModal)">添加</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌号、手机号、工号">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备ID</th>
										<th>公司名称</th>
										<th>车牌号码</th>
										<th>用户照片</th>
										<th>用户姓名</th>
										<th>工号</th>
										<th>手机号</th>
										<th>创建来源</th>
										<th>上次指令下发时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.deviceId}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>
											<button *ngIf="row.userPic!=''" type="button" (click)="showImg1(row,imgModal1)">查看</button>
										</td>
										<td>{{row.userName}}</td>
										<td>{{row.jobNum}}</td>
										<td>{{row.phone}}</td>
										<td>{{row.updateSource}}</td>
										<td>{{row.commandTime}}</td>
										<td>
											<button type="button" (click)="showEditUserModal(row,addUserModal)">编辑</button>
											<button type="button" (click)="issueInstructions(row)">下发指令</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>

<!-- 新增项目车辆   弹窗-->
<section bsModal #addUserModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">


		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeAddUserModal(addUserModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title"><span *ngIf="formType == 'add'">新增</span><span *ngIf="formType == 'update'">编辑</span>用户信息</h4>
			</div>
			<form id="userForm"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
				<div class="modal-body">
					<div class="row form-horizontal">


						<div class="form-group col-xs-12 s_fix_select2_width s_fix_select2">
							<label class="control-label col-xs-3" for="newPassword">车牌号码<sup>*</sup></label>
							<div class="col-xs-9" >
								<input type="hidden"  class="form-control" name="carNumberFrom" id="carNumberFrom" [(ngModel)]='userObj.carNumber'/>
								<sa-select2 select2ElementID="carSelect2" (optionSelected)="optionSelected($event)" matchSearch="true"></sa-select2>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">设备ID<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="deviceId" readonly [(ngModel)]='userObj.deviceId'/>
							</div>
						</div>


						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">用户姓名<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="userName"  [(ngModel)]='userObj.userName'/>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">工号<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="jobNum"  [(ngModel)]='userObj.jobNum'/>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3">手机号<sup>*</sup></label>
							<div class="col-xs-9" >
								<input class="form-control" name="phone"  [(ngModel)]='userObj.phone'/>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-xs-3 no-padding-right">用户照片</label>
							<div class="col-xs-9">
								<div class="imgFileList">
									<div class="imgFileList-other">
										<div class="imgFileList-multifile">
											<div class="uploadlocation uploadlocation1"> 
												<div class="content-list">
													<div class="headImg" *ngFor="let item of imageInfo.localImg; let i = index">
														<div class="contentImg"><img class="img" alt="用户照片"  [src]="item" (click)="bigImgClick()"></div>
															<i class="deleteImg" (click)="deleteImg('1',i)"></i>
													</div>
													<button type="button"  class="btn div_imgall">
														<div class="div_shuline"></div>
														<div class="div_hengline"></div>
														<input type="file" class="up" title=" " placeholder=" "  multiple (change)="multifileChange($event.target.files)"/>
													</button>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="closeAddUserModal(addUserModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="userInfoSubmit(addUserModal)">确认</button>
				</div>
			</form>
		</div>


	</div>
</section>
<!-- 新增项目车辆 弹窗end-->

<!-- 图片查看   弹窗-->
<section bsModal #imgModal1="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content" style="width: 570px;">
			<div class="modal-header">
				<button type="button" class="close" (click)="closeImgModal1(imgModal1)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
				<h4 class="modal-title">用户照片</h4>
			</div>
			<div class="modal-body">
				<div class="imagesInfo1">
					<div class="imgShow" *ngFor="let item of imgLocalList" (click)="bigimg()">
						<img [src]="item" alt="用户照片"  style="cursor: pointer;"/>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<!-- 图片查看 弹窗end-->